package service;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import dao.SysUsersDAO;
import org.springframework.transaction.annotation.Transactional;
import pojo.SysUsers;
import util.PageInfo;

@Service
public class SysUsersServiceImpl implements SysUsersService{
	@Autowired
	private SysUsersDAO dao;
	@Override
	public List<SysUsers> queryLogin(SysUsers users) {
		return dao.queryLogin(users);
	}

    @Override
    public PageInfo<SysUsers> queryByLike2(SysUsers sysUsers, int pageNum, int pageSize) {
        String hql="from SysUsers";
        return dao.queryByLike2(sysUsers,hql,pageNum,pageSize);
    }

    @Override
    public List<SysUsers> queryAll() {
        return dao.queryAll();
    }

    @Transactional
    public void userAdd(SysUsers sysUsers) {
dao.save(sysUsers);
    }

}
